import UIManager from '../../engine/UIManager';
import ViewBase from '../../engine/ViewBase';
import { AudioHelper } from '../audio/AudioHelper';
import { ViewConfig } from '../config/ViewConfig';
import { UserModel } from '../model/UserModel';
import { UIHelper } from '../util/UIHelper';

const { ccclass, property } = cc._decorator;

@ccclass
export class ViewHall extends ViewBase {

    // private btnUp: cc.Node
    // private btnMenuNode: cc.Node



    onEnable() {
        super.onEnable()
        AudioHelper.playBGM()

        let btnJoinRoom: cc.Node = this.findChild(this.node, "btnJoinRoom")
        UIHelper.onAddEvent(btnJoinRoom, () => {

        })

        let btnCreateRoom: cc.Node = this.findChild(this.node, "btnCreateRoom")
        UIHelper.onAddEvent(btnCreateRoom, () => {
            UIManager.instance.showView(ViewConfig.viewConfig.ViewCreateRoom)
        })

        let btnSetting:cc.Node = this.findChild(this.node, "btnSetting")
        UIHelper.onAddEvent(btnSetting, ()=>{
            UIManager.instance.showView(ViewConfig.viewConfig.ViewSetting)
        })
        let btnClub:cc.Node = this.findChild(this.node, "btnClub")
        UIHelper.onAddEvent(btnClub, ()=>{
            UIManager.instance.showView(ViewConfig.viewConfig.ViewClubList)
        })
        this.refresh()
    }

    private refresh() {
    
    }
}

